<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2>Vue自定义框架</h2>
        <!-- this.$data.msg -->
        <p>{{msg}}</p>
        <p>{{title}}</p>
        <button>修改msg</button>
        <label for="">{{msg}}</label>
        <span>{{msg}}</span>
    </div>
    <script>
        import Vue from "vue"
        const app = new Vue({
            el:"#app",
            data(){
                return{
                    msg:"南京",
                    title:"蜗牛",
                    stu:{
                        id:1
                    }
                }
            },
            methods: {
                addTask(){
                    // // this.$set(this.stu,"name","xiaowang")
                    // const newStu = Object.assign({name:"xiaowang"},this.stu)
                    // // this.stu = newStu
                    // this.stu = {id:1,name:"xiaowang"}
                    //如果遇到 你修改数据,页面没有变化.强制让vue刷新一次页面
                    this.$forceUpdate()
                }
            },
        })
        // console.log(app);
        console.log(app.msg);
        app.msg = "北京"
        
    </script>
</body>
</html>